<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
   <title>课程管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
		<load href= "__JS__/jshelper.js" /> 
			<script type="text/JavaScript">
				function courseedit(id){
					window.location.href="__URL__/courseedit/id/"+id;
				}
				function coursesearch(id){
					window.location.href="__URL__/coursedetail/id/"+id;
				}
				function coursedelete(id){
					if (confirm("你确定要删除吗")==true) 
						postwith('__URL__/coursedelete',{id:id});
				}
				function course(id)
				{
					postwith('__URL__/course',{id:id});
				}
				
				window.onload=show;
			</script>
</head>
<body>
<layout name="Auth:header" />
 <div class="container-fluid">
      <div class="row-fluid">
      <layout name="Auth:leftmenu" />
      	 <div class="span8">
          <div class="hero-unit">
          	<h1>课程管理</h1>
            	<p style="font-size:12px">当前位置：
                	<a href='__APP__/index/index'  >主页</a>>
                    <a href='__URL__/index' >后台管理</a>>
                    <a href="__URL__/coursedetail"  >课程管理</a>
                </p>
            </div>
            <if condition="$role neq '教师'">
            <table class="table table-striped table-bordered table-condensed">
                <thead>
                	<tr>
                    	<th style="background-color:#09F">
                            管理员课程操作
                        </th>
                	</tr>
                </thead>
                <tbody>
                	<tr>
                    	<td>
                        	<a href="__URL__/courseadd" class="btn btn-success">添加课程</a>
                            <a href="__URL__/courseapprove" class="btn btn-primary" title="所选课程教师管理员二次确认">课程认证</a>
                        </td>
                    </tr>
                </tbody>
            </table>
			</if>
           <form class="form-inline" method="get" action="__URL__/coursedetail" >
           <table  class="table table-striped table-bordered table-condensed">
           	<thead>
            	<tr style="background-color:#09F">
                	<th style="color:#000">课程查询</th>
                </tr>
            </thead>
            <tbody>
            	<tr>
                	<td>
                    	<input type="text" name="number" placeholder="课程序号">
                        <input type="text" name="name" placeholder="课程名称">
                        <code>院系名称</code><select name="dname" >
                                    <option value></option>						  
                                        <volist name='deplist' id='vo'>
                                            <option value =	{$vo.name}>{$vo.name}</option>
                                        </volist>
                                </select>
                        <input type="submit" onClick="coursesearch(id)" value="查询" class="btn btn-primary">
                    </td>
                </tr>
            </tbody>
           </table>	
		</form> 
			<table class="table table-striped table-bordered table-condensed">
            	<thead>
                	<tr style="background-color:#09F">
                    	<th style="display:none">课程ID</th>
                    	<th style="width:10%">课程序号</th>
                        <th style="width:35%">课程名称</th>
                        <th style="width:15%">所属院系</th>
                        <th style="width:40%">操作</th>
                    </tr>
                </thead>
                <load href"__PUBLIC__/js/list_show.js">
                <tbody>
                	<volist name='list' id='vo' >
                	<tr>
                    	<td style="display:none">{$vo.id}</td>
                        <td>{$vo.number}</td>
                        <if condition="$vo.isselect neq 0">
                        <td><strong>{$vo.name} (已选择)</strong></td></td>
                       	<else/>
                        <td>{$vo.name}</td>
                        </if>
                        <td>{$vo.dname}</td>
                        <td>
                        	<if condition="$vo.isselect eq 0">
                            <a name="courseedit" onClick="course('{$vo.id}')" href="#" class="btn btn-success">选择</a>
                            <!--<input type="button" name="courseedit"  onClick="course({$vo.id})" value="选择">-->
                            <else/>
                            <a name="courseedit" onClick="course('{$vo.id}')" href="#" class="btn btn-warning">取消</a>
                            <!--<input type="button" name="courseedit"  onClick="course({$vo.id})" value="取消">-->
                       		 </if>
                                <if condition='$vo.select eq 1'>
                                    <a name="courseedit" onClick="courseedit('{$vo.id}')" href="#" class="btn btn-primary">编辑</a>
                                </if>
                                <if condition="$role neq '教师'">
                                    <a name="delete_course" onClick="coursedelete('{$vo.id}')"   href="#" class="btn btn-danger">删除</a>				
                                </if>
               		 </td>
               		 </tr>
                  </volist>
                </tbody>
            </table>
             <p class="navbar-text pull-right">{$page}</p>
          </div>
          </div>
         </div>
       
		<script src="__JS__/placeholderIEshow.js"></script>
</body>
</html>